package com.kedou.sdk.params.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class WindowMessage implements Parcelable {

    @SerializedName("icon")
    private String icon;

    @SerializedName("title")
    private String content;

    @SerializedName("jump_type")
    private String jumpType;

    @SerializedName("jump_url")
    private String jumpUrl;

    @SerializedName("save_time")
    private String saveTime;

    private String appendString;

    private NavModel navModel;

    public String getAppendString() {
        return appendString;
    }

    public void setAppendString(String appendString) {
        this.appendString = appendString;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getJumpType() {
        return jumpType;
    }

    public void setJumpType(String jumpType) {
        this.jumpType = jumpType;
    }

    public String getJumpUrl() {
        return jumpUrl;
    }

    public void setJumpUrl(String jumpUrl) {
        this.jumpUrl = jumpUrl;
    }

    public String getSaveTime() {
        return saveTime;
    }

    public void setSaveTime(String saveTime) {
        this.saveTime = saveTime;
    }

    public WindowMessageType toMessageType(){
        return WindowMessageType.valueOfEnum(jumpType);
    }

    public NavModel getNavModel() {
        return navModel;
    }

    public void setNavModel(NavModel navModel) {
        this.navModel = navModel;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.icon);
        dest.writeString(this.content);
        dest.writeString(this.jumpType);
        dest.writeString(this.jumpUrl);
        dest.writeString(this.saveTime);
        dest.writeString(this.appendString);
        dest.writeParcelable(this.navModel, flags);
    }

    public WindowMessage() {
    }

    protected WindowMessage(Parcel in) {
        this.icon = in.readString();
        this.content = in.readString();
        this.jumpType = in.readString();
        this.jumpUrl = in.readString();
        this.saveTime = in.readString();
        this.appendString = in.readString();
        this.navModel = in.readParcelable(NavModel.class.getClassLoader());
    }

    public static final Creator<WindowMessage> CREATOR = new Creator<WindowMessage>() {
        @Override
        public WindowMessage createFromParcel(Parcel source) {
            return new WindowMessage(source);
        }

        @Override
        public WindowMessage[] newArray(int size) {
            return new WindowMessage[size];
        }
    };
}
